package server;


import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class MainServer {
    public static void main(String [] args){
        boolean flag = true;
        try {
            ServerSocket server = new ServerSocket(12345);
            System.out.println("服务器已启动");
            System.out.println("等待客户端连接中.......");
            while (flag) {
                Socket socket = server.accept();
                System.out.println("一个客户端连接成功!");
                new Thread(new ServerInstructionJudge(socket)).start();
            }
        } catch (IOException e) {
            System.out.println("服务器异常关闭");
            flag=false;
        }
    }
}
